import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralStaffInfo = (params) => {
  params.head.transCode = 'queryGeneralStaffInfo';
  return request({
    url: '/general/generalStaffInfo/queryGeneralStaffInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralStaffInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralStaffInfoListPage';
  return request({
    url: '/general/generalStaffInfo/queryGeneralStaffInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralStaffInfo = (params) => {
  params.head.transCode = 'saveGeneralStaffInfo';
  return request({
    url: '/general/generalStaffInfo/saveGeneralStaffInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralStaffInfoList = (params) => {
  params.head.transCode = 'saveGeneralStaffInfoList';
  return request({
    url: '/general/generalStaffInfo/saveGeneralStaffInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralStaffInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralStaffInfo';
  return request({
    url: '/general/generalStaffInfo/saveOrUpdateGeneralStaffInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralStaffInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralStaffInfoList';
  return request({
    url: '/general/generalStaffInfo/saveOrUpdateGeneralStaffInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralStaffInfo = (params) => {
  params.head.transCode = 'updateGeneralStaffInfo';
  return request({
    url: '/general/generalStaffInfo/updateGeneralStaffInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralStaffInfo = (params) => {
  params.head.transCode = 'deleteGeneralStaffInfo';
  return request({
    url: '/general/generalStaffInfo/deleteGeneralStaffInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralStaffInfoList = (params) => {
  params.head.transCode = 'deleteGeneralStaffInfoList';
  return request({
    url: '/general/generalStaffInfo/deleteGeneralStaffInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralStaffInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalStaffInfo/excelDownload/exportGeneralStaffInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
